<?php
/**
 * View_Map
 *
 * Класс предназначен для отображения карт
 * @author Гринько Виталий <vitalygrinko@gmail.com>
 * @version 2.2
 */
class View_Map {


    public static function showMap($arrSetting, $idMap = "map_canvas", $hide = false, $htmlOnly = false) {
        
      $text = '<div class="googleMap">';
      $text .= '<div class="googleMapInside" id="' . $idMap . '_wrap" style="' . ($hide ? ' height: 0px;' : ' height: ' . ($arrSetting['height'] + 4) . 'px;
	                                             ')  . ($arrSetting['width'] != 550 ? ('width: ' . ($arrSetting['width'] + 4) . 'px;') : null) . '"' . ($hide ? ' init=0' : '') . '>
	            <div id="' . $idMap . '" style="width: ' . ($arrSetting['width']) . 'px;
	                                            height: ' . $arrSetting['height'] . 'px; " class="map"
	                                     lat="' . (isset($arrSetting['lat']) ? $arrSetting['lat'] : '') . '"
	                                     lng="' . (isset($arrSetting['lng']) ? $arrSetting['lng'] : '') . '"
	                                     zoom="' . (isset($arrSetting['zoom']) ? $arrSetting['zoom'] : '') . '"
	            </div><div class="clear"></div></div>';
	      $text .= '</div>';
	      if ($htmlOnly) return $text;
	      else echo $text;
    }

//    static public function showMapSimple($arrSetting, $idMap = "map_canvas", $hide = false) {
//      echo '<div id="map_canvas_wrap" style="' . ($hide ? ' height: 0px;' : ' height: ' . ($arrSetting['height'] + 4) . 'px;
//                                             border: 3px solid #dbdbdb;margin-bottom: 5px;')  . ($arrSetting['width'] != 550 ? ('width: ' . ($arrSetting['width'] + 4) . 'px;') : null) . '"' . ($hide ? ' init=0' : '') . '>';
//      echo '<div style="' . ($hide ? 'height: 0;' : '')  . 'width: ' . $arrSetting['width'] . 'px;
//                                            height: ' . $arrSetting['height'] . 'px; border: 2px solid #fff;" id="' . $idMap . '" style="width: ' . $arrSetting['width'] . 'px;
//                                            height: ' . $arrSetting['height'] . 'px">
//            </div></div>';
//    }



}
?>